package com.qfedu.micrograss.grass.controller;

import com.qfedu.common.core.common.R;
import com.qfedu.micrograss.grass.param.GrassParam;
import com.qfedu.micrograss.grass.service.GrassService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 以梦为马，以汗为泉，不忘初心，不负韶华
 * @author zqh (ZQH)
 * @date 2025/6/5 21:25
 * @version 1.0
 */
@RestController
@RequestMapping("article")
public class GrassController {
    @Resource
    private GrassService grassService;

    /**
     * 添加文章
     * @param grassParam
     * @return
     */
    @PostMapping("/add")
    public R addGrass(@RequestBody GrassParam grassParam){
        grassService.addGrass(grassParam);
        return R.ok();
    }

}